﻿@using KMF.WebUI.Areas.KMFadmin.CustomHelpers
@using KMF.WebUI.Areas.KMFadmin.Models
@model IEnumerable<KMF.Common.GoldenTimeCampainDto>
@{
    ViewBag.Title = "Giờ vàng";
    Layout = "~/Areas/KMFadmin/Views/Shared/_layout.cshtml";
}
<nav>
    <div class="breadCrumb">
        <ul>
            <li><a href="@Url.Action("Index", "AdminHome")"><i class="bootstrap icon-home"></i></a></li>
            <li><a href="javascript:void(0)">Sản phẩm</a> </li>
            <li><a href="@Url.Action("Index", "AdminGoldenTime")">Danh sách giờ vàng</a> </li>
        </ul>
    </div>
</nav>
<div class="toolBox">
    @Html.ToolBox(new List<object> { new Add { ClassCss = "Add", ActionName = @Url.Action("Add", "AdminGoldenTime") } })
</div>
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;" class="goldenTimeTable2">
    <tr>
        <th>#</th>
        <th>@Html.CheckBox("chkAll")</th>
        <th>Tên chiến dịch</th>
        <th>Ngày bắt đầu</th>
        <th>Giờ</th>
        <th>Trạng thái</th>
    </tr>
    @{
        
        if (Model != null && Model.Count() > 0)
        {
            var count = 0;
            foreach (var item in Model)
            {
                count++;
        <tr>
            <td>@count</td>
            <td>
                @Html.CheckBox("chkItem")
            </td>
            <td style="text-align: left;">
                <a href="@Url.Action("GoldenTimeProductAdd", "AdminGoldenTime", new { goldId = @item.Id })">@item.CampainName</a>
            </td>
            <td>
                @item.DateBegin.ToString("dd/MM/yyyy") <span>-</span> @item.DateEnd.ToString("dd/MM/yyyy")
            </td>
            <td>
                @item.FromHour<span>h</span> - @item.ToHour<span>h</span>
            </td>
            <td>
                @{
                if (item.Status.Equals("kichhoat"))
                {
                    <span style="color: red;">Đang kích hoạt</span>
                }
                else if (item.Status.Equals("chuakichhoat"))
                {
                    <span>Chưa kích hoạt</span>                 
                }
                else
                {
                    <span>Kết thúc</span>
                }
                }

            </td>
        </tr>
            }
        }
    }
</table>
